import Taro from '@tarojs/taro'
import { View,Text,Image,} from '@tarojs/components'
import { useEffect,useState } from 'react'
import { showcooperativeUnit} from '../../../api/mode'
import { JumpCard } from '../../../components'
import './index.scss'

export default function AboutUS(){

const [unitInfo,setUnitInfo]=useState([])

useEffect(()=>{
  showcooperativeUnit().then(res=>{
    console.log(res.data.data)
    setUnitInfo(res.data.data)
  })
},[])

const jumpto=()=>{
  Taro.redirectTo({
    url: '/mine/pages/aboutUs/aboutUs'//跳转到合作单位
  })
}

  return(
    <View>

      <View className='unit'>
      <View className='unitContent'>
      <Text className='unitIntro'>合作单位</Text>
        <View className='at-row at-row--wrap'>
        {unitInfo?unitInfo.map((Info,index)=>(

            <View key={index} userInfo={Info} className='unitItem at-col'>
                <Text className='unitName'>
                  {Info.name}
                </Text>
                <Image src={'data:image/png;base64,'+Info.photo} className='unitPhoto' />
            </View>


            ))
            :null}
        </View>
      </View>
     <View className='unitJumpCard'>
     <JumpCard className='jumpCard' context='崇军介绍' handleClick={jumpto} />
     </View>
      </View>

    </View>
  )
}